import { S } from '../s';
import { IPSCtrlMsg } from './ipsctrl-msg';
import { IPSCtrlMsgItem } from './ipsctrl-msg-item';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSCtrlMsgImpl extends PSModelObjectImpl implements IPSCtrlMsg {
  get codeName(): string {
    return this.M.codeName;
  }

  get msgModel(): string {
    return this.M.msgModel;
  }

  protected psctrlmsgitems: IPSCtrlMsgItem[];
  getPSCtrlMsgItems(): IPSCtrlMsgItem[] | null {
    return (
      this.psctrlmsgitems ||
      (this.psctrlmsgitems = this.fillChildListModel(
        this.M.getPSCtrlMsgItems,
        S._3f4,
      ) as IPSCtrlMsgItem[])
    );
  }

  findPSCtrlMsgItem(objKey: any): IPSCtrlMsgItem | null {
    return this.getPSModel5(
      S._3f4,
      this.getPSCtrlMsgItems(),
      objKey,
    ) as IPSCtrlMsgItem;
  }
  get cls(): string {
    return 'PSCtrlMsgImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._275) return true;
    return super.instanceof(cls);
  }
}
